import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { StoreComponent } from './tabbar/store/store.component';
import { TrolleyComponent } from './tabbar/trolley/trolley.component';
import { CenterComponent } from './tabbar/center/center.component';
import { TabbarComponent} from './tabbar/tabbar.component';


const routes: Routes = [
  {
    path: 'tabbar', component: TabbarComponent,
    children: [
      {
        path: 'store', component : StoreComponent
      },
      {
        path: 'trolley', component : TrolleyComponent
      },
      {
        path: 'center', component : CenterComponent
      },
      {
        path: '**', redirectTo : 'store'
      }
    ]
  },
  {
    path: '**', redirectTo : 'tabbar'
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
